package com.m7788.util;

import android.content.Context;

import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationClientOption.AMapLocationMode;
import com.amap.api.location.AMapLocationListener;

public class GaodeLocationManager{
	private static AMapLocationClientOption mLocationOption = null;	
	private static AMapLocationClient mlocationClient = null;
	public static void startLocation(Context context,AMapLocationListener locationListener){
		mlocationClient = new AMapLocationClient(context);
		//初始化定位参数
		mLocationOption = new AMapLocationClientOption();
		//设置定位监听
		mlocationClient.setLocationListener(locationListener);
		//设置定位模式为高精度模式，Battery_Saving为低功耗模式，Device_Sensors是仅设备模式
		mLocationOption.setLocationMode(AMapLocationMode.Hight_Accuracy);
		mLocationOption.setOnceLocation(true);
		mlocationClient.setLocationOption(mLocationOption);
		mlocationClient.startLocation();
	}
}
